---
layout: default
title: Posts
---

<h1>{{ page.title }}</h1>

<div class="page page-index">
    {% for post in site.posts -%}
    {%- capture post_year %}{{ post.date | date: "%Y" }}{% endcapture -%}
    {%- capture post_previous_year %}{{ post.previous.date | date: "%Y" }}{% endcapture -%}
    {%- capture post_next_year %}{{ post.next.date | date: "%Y" }}{% endcapture -%}
    <div class="list-post">
        {%- if forloop.first or post_next_year != post_year -%}
        <h2 id="{{post_year}}">{{post_year}}</h2>
        <ul class="post-list">
            {%- endif %}
            <li class="post-archive">
                <h2><a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a></h2>
                <span class="post-time">{{ post.date | date_to_string }}</span>
                {% for tag in post.tags %}
                <span class="tag">
                    <a href="{{ site.baseurl }}{{ site.data.nav[2].url }}#{{ tag }}">{{ tag }}</a>
                </span>
                {% endfor %}
            </li>
            {%- if forloop.last or post_previous_year != post_year %}
        </ul>
    </div>
    {%- endif %}
    {%- endfor %}
</div>